<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Model\AdminPermission;
class PermissionController extends BaseController
{
    /*
     * 用户列表
     */
    public function index()
    {
//         echo 1;exit;
        $permissions = AdminPermission::get();
        // dump($permissions);exit;
        return view('Admin.permission.index', compact('permissions'));
    }

    /*
     * 创建用户
     */
    public function create()
    {
        return view('Admin.permission.add');
    }

    /*
     * 创建用户
     */
    public function store(Request $request)
    {
        AdminPermission::create(request(['name', 'description']));
        return redirect('/admin/permissions');
    }
}
